<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>后台管理</title>
	<link rel="stylesheet" type="text/css" href="${rc.contextPath}/static/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="${rc.contextPath}/static/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="${rc.contextPath}/static/css/back.css">
		<script type="text/javascript" src="${rc.contextPath}/static/js/jquery.min.js"></script>
		<script type="text/javascript" src="${rc.contextPath}/static/js/jquery.easyui.min.js"></script>
		<script type="text/javascript" src="${rc.contextPath}/static/js/easyui-lang-zh_CN.js"></script>
		<script type="text/javascript" src="${rc.contextPath}/static/js/validate.js"></script>
		<script type="text/javascript" src="${rc.contextPath}/static/js/Chart.js"></script>
		<script src="http://lib.baomitu.com/modernizr/2.8.2/modernizr.min.js"></script>
		
		<script type="text/javascript">
			var contextPath = "${rc.contextPath}";
			$(function() {
				$('#tt').tabs({   
      				border:false,   
      				onSelect:function(title){   
          				var tab = $('#tt').tabs('getSelected');
						$('#tt').tabs('update', {
							tab: tab,
							options: {
								title: title,
								href: tab.href
							}
						});  
     		 		}
     			});
     		});
			
			function open1(plugin,title){
				if ($('#tt').tabs('exists',title)){
					$('#tt').tabs('select', title);
				} else {
					$('#tt').tabs('add',{
						title: title,
						href: plugin,
						closable: true,
						extractor: function(data){
							return data;
						}
					});
				}
			}
			
			$.get("${rc.contextPath}/account/currentAdminAccount", function(result) {
				$('#currentAccount').text(result.name);
				if(result.lastLoginIp!=null)
					$('#lastLoginIp').text(result.lastLoginIp);
				if(result.lastLoginTime!=null)
					$('#lastLoginTime').text(result.lastLoginTime);
			});
			
			function logout() {
				$.get("${rc.contextPath}/account/logout", function(result) {
					if(result.success == true) {
						location.href="${rc.contextPath}/account/employeeLoginForm";
					}
				});
			}
			function openUpdatePwd() {
				$("#updatePwd").dialog("open").dialog("setTitle", "修改登录密码");
			}
			function cancelUpdatePwd() {
				$("#fmpwd").form('clear');
				$("#updatePwd").dialog("close");
			}

			function updatePwd() {
				$("#fmpwd").form("submit", {
					url : "${rc.contextPath}/account/updateAdminPassword",
					onSubmit : function() {
						var vd = $(this).form("validate");
						return vd;
					},
					success : function(result) {
						if (result != null && result.length > 0) {
							result = eval("(" + result + ")");
							if (result.success) {
								$.messager.alert('成功', "密码修改成功，请重新登录", 'info');
								$("#fmpwd").form('clear');
								$("#updatePwd").dialog("close");
							} else {
								if (result.msg != null) {
									$.messager.alert('异常提示', result.msg, 'error');
								} else {
									$.messager.alert('异常提示', '提交出现异常，请检查您的输入项，或与管理员联系', 'error');
								}
							}
						} else {
							$.messager.alert('异常提示', '提交出现异常，请检查您的输入项，或与管理员联系', 'error');
						}
					},
					onLoadError : function(XMLHttpRequest) {
						$.messager.alert('异常提示', XMLHttpRequest.responseText, 'warning');
					}
				});
			}
			
			var colorTime;
			var colorTime2;
			var idInt = setInterval(function(){
				$.get("${rc.contextPath}/trade/checkCarAdminWaitNum", function(result) {
					if(result > 0) {
						if(colorTime) {
						    clearInterval(colorTime);
						}
						colorTime = setInterval(function(){
							var color = new Array("#000088","#003300","#CC3300","#CC9900","#FF9933","#000000","#993300","#FFFF00","#66FF00","#663366","#330033");
							var i = Math.round(Math.random()*10);
							$('#pendingItem').html(result);
							$('#pendingItem').css("color",color[i]);
						},1000);
						//$('#messageSound')[0].play();
					} else {
						$('#pendingItem').html(result);
						clearInterval(colorTime);
					}
				});
				
				
				
			},60000);
			
			
			var contextPath = "${rc.contextPath}";
		</script>
		<script type="text/javascript" src="${rc.contextPath}/static/js/bk.js?v=${StringUtil.getRandom(5)}"></script>
		<link rel="shortcut icon" href="${rc.contextPath}/static/images/favicon.ico"/>
		<link rel="bookmark" href="${rc.contextPath}/static/images/favicon.ico"/>
</head>
<body class="easyui-layout">
	<div data-options="region:'north',split:true" title="后台管理" style="height:100px;padding:10px;">
		<span style="color:#000;font-size:22px;font-weight:bold;text-decoration:none;float:left;">后台管理
		</span>
		<span style="float:right;font-size:16px;">
		您好，<span id="currentAccount"></span>，[<a href="#" onclick="openUpdatePwd()">修改密码</a>]
		<span id="canBinding" style="display:none;">[<a href="#" onclick="openBindingDialog()">二维码</a>]</span>
		[<a href="#" onclick="logout();">退出</a>] <br/>
		<a href="#" onclick="doCheckCar();">待处理订单&nbsp;<span id="pendingItem">0</span>&nbsp;条</a>&nbsp;
		<audio autoplay="false" id="messageSound"><source src="${rc.contextPath}/static/sound/hooter.mp3" type="audio/mpeg"/></audio>
		</span>
	</div>
	<div data-options="region:'west',split:true" title="菜单" style="width:280px;padding1:1px;overflow:hidden;">
		<div class="easyui-accordion" data-options="fit:true,border:false">
			
			<div title="框架示例" data-options="selected:true" style="padding:10px;overflow:auto;">
				<ul id="ExampleView" class="easyui-tree" data-options="animate:true,dnd:false">
					<li><span><a href="#" onclick="open1('${rc.contextPath}/example/classificationAdminView','图书种类')">图书种类</a></span></li>
					<li><span><a href="#" onclick="open1('${rc.contextPath}/example/bookAdminView','图书列表')">图书列表</a></span></li>
					<li><span><a href="#" onclick="open1('${rc.contextPath}/student/specialtyView','专业分类')">专业分类</a></span></li>
					<li><span><a href="#" onclick="open1('${rc.contextPath}/student/studentView','学生列表')">学生列表</a></span></li>
					<li><span><a href="#" onclick="open1('${rc.contextPath}/computer/computerView','电脑列表')">电脑列表</a></span></li>
					<li><span><a href="#" onclick="open1('${rc.contextPath}/computer/computerTypeView','电脑类型')">电脑类型</a></span></li>

				</ul>
			</div>
			<div title="车场管理" data-options="selected:true" style="padding:10px;overflow:auto;">
				<ul id="Parking" class="easyui-tree" data-options="animate:true,dnd:false">
					<li><span><a href="#" onclick="open1('${rc.contextPath}/parking/parkingView','停车场管理')">停车场管理</a></span></li>
				</ul>
			</div>
			<div title="用户管理" data-options="selected:false" style="padding:10px;overflow:auto;">
				<ul id="Account" class="easyui-tree" data-options="animate:true,dnd:false">
					<li data-options="state:'closed'">
						<span>会员管理</span>
						<ul>
							<li><span><a href="#" onclick="open1('${rc.contextPath}/member/memberAdminView','会员管理')">会员管理</a></span></li>
						</ul>
					</li>
					<li data-options="state:'closed'">
						<span>后台用户管理</span>
						<ul>
							<li><span><a href="#" onclick="open1('${rc.contextPath}/account/employeeAdminView','后台用户列表')">后台用户列表</a></span></li>
						</ul>
					</li>
					<li data-options="state:'closed'">
						<span>权限管理</span>
						<ul>
							<li><span><a href="#" onclick="open1('${rc.contextPath}/project/permissionFunctionAdminView','功能设置')">功能设置</a></span></li>
							<li><span><a href="#" onclick="open1('${rc.contextPath}/project/permissionRoleAdminView','角色设置')">角色设置</a></span></li>
							<li><span><a href="#" onclick="open1('${rc.contextPath}/project/permissionRoleTypeAdminView','角色类型')">角色类型</a></span></li>
						</ul>
					</li>
				</ul>
			</div>
			
			<div title="商户管理" data-options="selected:false" style="padding:10px;overflow:auto;">
				<ul id="Group" class="easyui-tree" data-options="animate:true,dnd:false">
					<li data-options="state:'closed'">
						<span>电子发票管理</span>
						<ul>
							<li><span><a href="#" onclick="open1('${rc.contextPath}/electronicInvoice/electronicAdminView','销方企业管理')">销方企业管理</a></span></li>
							<li><span><a href="#" onclick="open1('${rc.contextPath}/electronicInvoiceGf/electronicInvoiceGfAdminView','购方企业管理')">购方企业管理</a></span></li>
							<li><span><a href="#" onclick="open1('${rc.contextPath}/electronicInvoiceKp/electronicAdminView','开具发票管理')">开具发票管理</a></span></li>
							<li><span><a href="#" onclick="open1('${rc.contextPath}/goods/goodsAdminView','商品编码管理')">商品编码管理</a></span></li>
						</ul>
					</li>
					<li><span><a href="#" onclick="open1('${rc.contextPath}/group/merchantAdminView','商户管理')">商户管理</a></span></li>
					<li><span><a href="#" onclick="open1('${rc.contextPath}/group/parkingPlaceAdminView','停车区管理')">停车区管理</a></span></li>
					<li><span><a href="#" onclick="open1('${rc.contextPath}/group/parkingPlaceTypeAdminView','停车区类型')">停车区类型</a></span></li>
				</ul>
			</div>
			
			<div title="路内停车" data-options="selected:false" style="padding:10px;overflow:auto;">
				<ul id="Curbparking" class="easyui-tree" data-options="animate:true,dnd:false">
					<li data-options="state:'closed'">
						<span>基础数据维护</span>
						<ul>
							<li><span><a href="#" onclick="open1('${rc.contextPath}/curbparking/carTypeAdminView','车型管理')">车型管理</a></span></li>
							<li><span><a href="#" onclick="open1('${rc.contextPath}/curbparking/plateColorAdminView','车牌颜色')">车牌颜色</a></span></li>
							<li><span><a href="#" onclick="open1('${rc.contextPath}/curbparking/parkRecordStatusAdminView','停车状态')">停车状态</a></span></li>
							<li><span><a href="#" onclick="open1('${rc.contextPath}/curbparking/berthStatusAdminView','泊位状态')">泊位状态</a></span></li>
							<li><span><a href="#" onclick="open1('${rc.contextPath}/curbparking/deviceStatusAdminView','设备状态')">设备状态</a></span></li>
							<li><span><a href="#" onclick="open1('${rc.contextPath}/curbparking/pictureGalleryTypeAdminView','图片集类别')">图片集类别</a></span></li>
						</ul>
					</li>
					<li><span><a href="#" onclick="open1('${rc.contextPath}/berth/berthAdminView','泊位管理')">泊位管理</a></span></li>
					<li><span><a href="#" onclick="open1('${rc.contextPath}/device/deviceAdminView','设备管理')">设备管理</a></span></li>
					<li><span><a href="#" onclick="open1('${rc.contextPath}/picture/pictureGalleryAdminView','图片集')">图片集</a></span></li>
					<li><span><a href="#" onclick="open1('${rc.contextPath}/curbparking/plateNumberAdminView','车牌库')">车牌库</a></span></li>
					<li><span><a href="#" onclick="open1('${rc.contextPath}/parkrecord/parkRecordAdminView','停车记录')">停车记录</a></span></li>
				</ul>
			</div>
			
		</div>
	</div>
	<div data-options="region:'center'" title="主界面" style="overflow:hidden;">
		<div id="tt" class="easyui-tabs" data-options="fit:true,border:false">
			<div title="欢迎" data-options="closable:true" style="padding:5px;">
				欢迎使用后台管理系统
				<div style="float :right">上次登录IP：<span id="lastLoginIp"></span> &nbsp;&nbsp;&nbsp;登录时间：<span id="lastLoginTime"></span> </div>
			</div>
		</div>
	</div>
	<div id="lastUpdateOperationLog" class="easyui-dialog" closed="true" resizable="true" minimizable="true" collapsible="true" maximizable="true" style="width:55%;height:70%;padding:10px 20px">
		<div class="ftitle">最后修改日志</div>
		<table id="lastUpdateOperationLogData" class="easyui-datagrid"></table>
	</div>
	<div id="attachmentView" class="easyui-dialog" closed="true" resizable="true" minimizable="true" collapsible="true" maximizable="true" style="width:55%;height:70%;padding:10px 20px">
		<div id="attachmentViewItem"></div>
	</div>
	
	<div id="updatePwd" class="easyui-dialog" closed="true" resizable="true" minimizable="true" collapsible="true" maximizable="true" style="width:400px;350px;padding:10px 20px"
			 buttons="#updatePwd-buttons">
		<div class="ftitle">修改密码</div>
			<form id="fmpwd" modelAttribute="vm" method="post">
				<div class="fitem">
					<label>旧的密码:</label>
					<input name="oldpwd" id="oldpwdFormKey" type="password" class="easyui-textbox" style="width:120px" data-options="validType:['length[0,50]']" >
				</div>
				<div class="fitem">
					<label>新的密码:</label>
					<input name="password" id="passwordFormKey" type="password" class="easyui-textbox" style="width:120px" data-options="validType:['length[0,50]']" >
				</div>
				<div class="fitem">
					<label>确认密码:</label>
					<input name="repassword" id="repasswordFormKey" type="password" class="easyui-textbox" style="width:120px" data-options="validType:['length[0,50]']" >
				</div>
			</form>
		</div>

	</div>
	<div id="updatePwd-buttons">
		<a href="#" class="easyui-linkbutton" iconCls="icon-ok" onclick="updatePwd();">修改</a>
		<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="cancelUpdatePwd();"><@i18n.message "button.cancel"/></a>
	</div>
	
	<div id="employeeQrDialog" class="easyui-dialog" closed="true" resizable="true" minimizable="true" collapsible="true" maximizable="true" style="width:500px;height:450px;padding:10px 20px">
		<div id="employeeQrCode" style="text-align:center;"></div>
	</div>
</body>
</html>